﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：46172595-6b69-4526-b9da-426d663f5b05
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：MediaLibraryFactory
//Namespace：RuanRang.Media.Core
//Functions：MediaLibraryFactory  
//Created by Kevin Wang at 2013/2/2 23:05:09 http://blog.9un.org
//============================================================================== 

#region Usings

using System;
using RuanRang.Media.Core.Common;
using RuanRang.Media.Core.Internal.DataStructures;
using RuanRang.Media.Core.Io;
using RuanRang.Media.Core.Media;

#endregion

namespace RuanRang.Media.Core
{

    /// <summary>
    /// Delegate VlcMediaLibraryFactoryInitHandler
    /// </summary>
    /// <param name="factory">The factory.</param>
    public delegate void VlcMediaLibraryFactoryInitHandler(LibVlcFactory factory);

    /// <summary>
    /// Creates and instantiates all media library classes. Central
    /// factory of media library.
    /// </summary>
    public interface ILibVlcFactory
    {
        /// <summary>
        /// Creates the lib VLC intance.
        /// </summary>
        /// <param name="parameters">The parameters.</param>
        /// <returns>IntPtr.</returns>
        IntPtr CreateLibVlcHandle(string[] parameters);

        /// <summary>
        /// Creates the lib VLC media.
        /// </summary>
        /// <param name="mediaInput">The media input.</param>
        /// <returns></returns>
        BaseMedia CreateLibVlcMedia(MediaInput mediaInput);

        /// <summary>
        /// Creates the lib VLC media.
        /// </summary>
        /// <returns>IntPtr.</returns>
        IntPtr CreateLibVlcMediaPlayerHandle();

        /// <summary>
        /// Creates the lib VLC media play list.
        /// </summary>
        /// <returns>IntPtr.</returns>
        IntPtr CreateLibVlcMediaPlayListHandle();

        /// <summary>
        /// Creates player which can be used to control media playing.
        /// </summary>
        /// <returns>Player instance.</returns>
        IMediaPlayer CreatePlayer(PlayerOutput playerOutput, MediaPlayerType playerType);

        /// <summary>
        /// Creates window where player renders video.
        /// User can control position of window and it's size.
        /// </summary>
        /// <returns>Window for rendering video.</returns>
        MediaWindow CreateWindow();

        ///// <summary>
        ///// Creates the VLC log.
        ///// </summary>
        ///// <param name="log">The log.</param>
        ///// <param name="logVerbosityManager">The log verbosity manager.</param>
        ///// <returns>VlcLog.</returns>
        //VlcLog CreateVlcLog(ILog log, ILogVerbosityManager logVerbosityManager);

        // mb extract methods like this into another common interface, for example, IGlobalVlcManager
        /// <summary>
        /// Gets the interop structure.
        /// </summary>
        /// <returns>libvlc_instance_t.</returns>
        libvlc_instance_t GetInteropStructure();
    }
}